https://glot.io/snippets/gi7hxsrjsr/raw/main.lua